import SFormItem from '../../SFormItem';
import { ObjectWidgetScheme } from './scheme';
import useObservableState from '@/pages/form-model/observeState';

export default function ObjectWidget(props: ObjectWidgetScheme) {
  const { formProperty } = props;
  const [properties] = useObservableState(formProperty.$showProperties);

  return (
    <>
      {properties?.map((item) => {
        return <SFormItem key={item.key} formProperty={item} />;
      })}
    </>
  );
}
